// 创建store仓库
// 1.引入创建方法
import { legacy_createStore as createStore } from 'redux'
// 2.设置默认数据
const defaultState = {
    count: 0,
    // tel: 0,//手机号
}
// 3.创建纯函数
interface actionType {
    type: string,
    payload?: any
}
const reducer = (state = defaultState, action: actionType) => {
    if (action.type = '+') {
        return state.count + action.payload
    }
    // else if (action.type = 'phone') {
    //     return state.tel + action.payload
    // }
    return state
}
// 4.创建store
const store = createStore(reducer)
// 5.导出
export default store